package com.hfh.main.group.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Getter
@Setter
@Accessors(chain = true)
@TableName("col_group")
@Schema(name = "GroupEntity", description = "$!{table.comment}")
public class GroupEntity extends Model<GroupEntity> {

    @Schema(description = "主键")
    @TableId(value = "group_id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "编号")
    @TableField("group_no")
    private String groupNo;

    @Schema(description = "名称")
    @TableField("group_name")
    private String groupName;

    @Schema(description = "排序")
    @TableField("group_sort")
    private String groupSort;

    @Schema(description = "第一阶段答辩得分")
    @TableField("db_first")
    private Double dbFirst;

    @Schema(description = "第二阶段答辩得分")
    @TableField("db_second")
    private Double dbSecond;

    @Schema(description = "中期答辩得分")
    @TableField("db_mid")
    private Double dbMid;

    @Schema(description = "终期答辩得分")
    @TableField("db_terminal")
    private Double dbTerminal;

    @Schema(description = "创建者")
    @TableField("create_by")
    private String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @Schema(description = "更新者")
    @TableField("update_by")
    private String updateBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    @TableField("update_time")
    private Date updateTime;

    @Schema(description = "伪删除")
    @TableField("undock")
    private Integer undock;

    @Schema(description = "状态")
    @TableField("state")
    private Integer state;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    //字段补充
    @Schema(description = "项目主键")
    @TableField("list_id")
    private String listId;

    @Schema(description = "项目编码")
    @TableField(exist = false)
    private String listNo;

    @Schema(description = "项目名称")
    @TableField(exist = false)
    private String listName;

    @Schema(description = "组长")
    @TableField(exist = false)
    private String leader;

    @Schema(description = "组长学号")
    @TableField("user_acc")
    private String acc;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
